// -------------------------------------------------------
//
//
// WTC_Heist by foRza
//
//
// -------------------------------------------------------
//
game_manager
{
	spawn 
   	{		
		// Game rules
		wm_axis_respawntime	1
		wm_allied_respawntime	1
		wm_number_of_objectives	5
		wm_set_round_timelimit	30

		//new objectives	
		//1 Axis steal Allied Gold
		//2 Axis deliver Allied Gold
		//3 capture Axis forward spawn	
		//4 capture Allied forward spawn
		//5 command post

		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1
		wm_set_main_objective		2	0
		wm_set_main_objective		2	1


		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0


		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	1

		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner	1

		wait 500

		//Accums
		accum 1 set 1//Axis objective

		wait 500

		//Flags not seen
		setstate axis_flag_wobj invisible
		setstate allied_flag_wobj invisible

		// Open outside elevator doors
		trigger door02_leftA open
		trigger door02_rightA open
		trigger door02_leftB open
		trigger door02_rightB open
		trigger door02_leftC open
		trigger door02_rightC open
		trigger door02_leftD open
		trigger door02_rightD open

		// start triggered loops on/off as required (eg: command post radio sounds)
		disablespeaker allies_compost_sound
		disablespeaker axis_compost_sound

		//floor 1 lights up on elevator panels///NEW
		remapshader "textures/wtc/lifta1" "textures/wtc/lifta1"
		remapshader "textures/wtc/liftb1" "textures/wtc/liftb1"
		remapshader "textures/wtc/liftc1" "textures/wtc/liftc1"
		remapshader "textures/wtc/liftd1" "textures/wtc/liftd1"

		remapshaderflush

		wait 2000

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "wtc_heist_axis_steal_gold"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "wtc_heist_allies_protect_gold"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "wtc_heist_axis_steal_gold"
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "wtc_heist_allies_protect_gold"
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

	}

//Objective Flags


	trigger axisobjectivecounter  //Capture of Allied Gold
           	 	{
                  	//Set accum to increase by 1 so we know that the objective has been completed
                       	accum 1 inc 1

                       	//Call function called checkgame in game_manager to check if the round has been won
                       	trigger game_manager axischeckgame
           		}

	trigger axischeckgame // checks to see if Axis win requirements have been met
            	{
                       	accum 1 abort_if_not_equal 2
                       	wm_setwinner 0
				wait 1500
                       	wm_endround
           		}

//Forward Spawns


	trigger axis_flagblue
	{
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of Axis flag
		wm_objective_status 3 0 2
		wm_objective_status 3 1 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the North Bunker!"
	}

	trigger axis_flagred
	{
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of Axis flag
		wm_objective_status 3 0 1
		wm_objective_status 3 1 2

		// Some kind of UI pop-up to alert players
		wm_announce "Axis capture the North Bunker!"

	}

	trigger allied_flagblue
	{
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of Allied flag
		wm_objective_status 4 0 2
		wm_objective_status 4 1 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the South Bunker!"
	}

	trigger allied_flagred
	{
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of Allied flag
		wm_objective_status 4 0 1
		wm_objective_status 4 1 2

		// Some kind of UI pop-up to alert players
		wm_announce "Axis capture the South Bunker!"

	}


} 

//End of Game_manager section

//Allied Gold. Axis team must capture and secure an Allied gold module containing critical gold
allied_gold //enter this as the scriptname value for the team_CTF_red/blueflag entity
{
	spawn
	{
	wait 200
	setstate allied_gold_captured invisible
	}

	trigger stolen

	{
	wm_announce "Axis have stolen the Allied Gold!"
	setstate allied_gold_cm_marker invisible

	wm_objective_status 1 0 1
	wm_objective_status 1 1 2
	
	// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "allied_obj_taken"
		wm_teamvoiceannounce 1 "axis_obj_taken"
	// *----------------------------------- vo ----*

	}

	trigger returned

	{
	wm_announce "The Allies have retrieved the Gold!"
	setstate allied_gold_cm_marker default

	wm_objective_status 1 0 2
	wm_objective_status 1 1 1
	
	// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "allied_obj_returned"
		wm_teamvoiceannounce 1 "axis_obj_returned"
	// *----------------------------------- vo ----*

	}

	trigger captured

	{
	wm_announce "The Axis have escaped with the Allied Gold!"
	setstate allied_gold_red invisible
	setstate allied_gold_captured default

	wm_objective_status 2 0 1
	wm_objective_status 2 1 2
	
	// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "allied_obj_lost"
		wm_teamvoiceannounce 0 "axis_obj_secured"
	// *----------------------------------- vo ------------------------------------------*


	}

}


allied_objectives //enter this as the scriptname value for the single trigger_flagonly_multiples entity 
{

death
	{
		trigger game_manager axisobjectivecounter
	}
}


axis_flag
{
	trigger axis_capture
	{
		trigger game_manager axis_flagred

	// *----------------------------------- vo ----*

		wm_teamvoiceannounce 0 "wtc_heist_axis_north_bunker_captured"
		wm_teamvoiceannounce 1 "wtc_heist_allies_north_bunker_reclaimed"

	// *----------------------------------- vo ----*

		//Axis flag appears
		setstate axis_flag_wobj default
	}

	trigger allied_capture
	{
		trigger game_manager axis_flagblue

	// *----------------------------------- vo ----*

		wm_teamvoiceannounce 0 "wtc_heist_axis_north_bunker_reclaimed"
		wm_teamvoiceannounce 1 "wtc_heist_allies_north_bunker_captured"

	// *----------------------------------- vo ----*

		wait 400 
		//Axis flag goes away
		setstate axis_flag_wobj invisible

	}
}

allied_flag
{
	trigger axis_capture
	{
		trigger game_manager allied_flagred

	// *----------------------------------- vo ----*

		wm_teamvoiceannounce 0 "wtc_heist_axis_south_bunker_captured"
		wm_teamvoiceannounce 1 "wtc_heist_allies_south_bunker_reclaimed"

	// *----------------------------------- vo ----*

		//Allied flag goes away
		setstate allied_flag_wobj invisible
	}

	trigger allied_capture
	{
		trigger game_manager allied_flagblue

	// *----------------------------------- vo ----*

		wm_teamvoiceannounce 0 "wtc_heist_axis_south_bunker_reclaimed"
		wm_teamvoiceannounce 1 "wtc_heist_allies_south_bunker_captured"

	// *----------------------------------- vo ----*

		wait 400
		//Allied flag appears
		setstate allied_flag_wobj default

	}
}



//////////////////////////CARS

plane
{
	spawn
	{
		wait 300
		trigger self move	// Trigger plane to start moving

	}

	trigger move
	{
		// Move sequence of plane--> old speed=500

		playsound sound/wtc/crownvic4.wav volume 450
		playsound sound/wtc/BOTB.wav LOOPING	 //NEW

		followspline 0 spl1 750	wait length 375
		playsound sound/wtc/skid.wav volume 400
		followspline 0 spl2 750 wait length 375
		followspline 0 spl3 750 wait length 375

		playsound sound/wtc/crownvic4.wav volume 450

		followspline 0 spl4 750 wait length 375
		playsound sound/wtc/skid.wav volume 400
		followspline 0 spl5 750 wait length 375
		followspline 0 spl6 750 wait length 375
		
		trigger self move		// Re-trigger this scriptblock, loop
	}
}

car
{
	spawn
	{
		wait 300
		trigger self move	// Trigger plane to start moving
	}

	trigger move
	{
		// Move sequence of plane--> old speed=500

		playsound sound/wtc/crownvic5.wav volume 500
		playsound sound/wtc/popo.wav LOOPING 	//NEW

		followspline 0 spline1 775 wait length 375
		playsound sound/wtc/skid.wav volume 400
		followspline 0 spline2 775 wait length 375
		followspline 0 spline3 775 wait length 375

		playsound sound/wtc/crownvic5.wav volume 500

		followspline 0 spline4 775 wait length 375
		playsound sound/wtc/skid.wav volume 400
		followspline 0 spline5 775 wait length 375
		followspline 0 spline6 775 wait length 375
		
		trigger self move		// Re-trigger this scriptblock, loop
	}
}



//////////////////////////////////////////////////////////////////////////////////////
//LIFTA	
//this is the routine that is called by our target_script_trigger for the lower button
//
//////////////////////////////////////////////////////////////////////////////////////
lower_pbutton_in_triggerA
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger pbutton_inA
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger lower_pbuttonA move_in
		trigger upper_pbuttonA move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger upper_pbutton_in_triggerA setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftA go_up
		trigger liftA go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lower_pbuttonA
{
	trigger move_in
	{
		//move button to in position
		gotomarker lower_pbutton_inA 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker lower_pbutton_outA 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}

//this is the routine that is called by our target_script_trigger for teh upper button
upper_pbutton_in_triggerA
{
	spawn
	{

		accum 2 set 0
	}
	trigger pbutton_inA
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger upper_pbuttonA move_in
		trigger lower_pbuttonA move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger lower_pbutton_in_triggerA setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftA go_up
		trigger liftA go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual upper button script_mover
upper_pbuttonA
{
	trigger move_in
	{
		//move button to in position
		gotomarker upper_pbutton_inA 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker upper_pbutton_outA 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}



//this is the routine that is called by our target_script_trigger
lift_button_in_triggerA
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger button_inA
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//now move the lift
		//because there is no if then statement we simply call both routines
		//button will only move in at the up or down position
		trigger lift_buttonA move_in_down
		trigger lift_buttonA move_in_up

		//set button state to 1 (in)
		accum 2 set 1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftA go_up
		trigger liftA go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lift_buttonA
{
	spawn
	{
		//button vert position 0=down 1=up
		accum 1 set 0
	}
	trigger move_in_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to in position
		gotomarker lower_button_inA 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to out position
		gotomarker lower_button_outA 16
	}
	trigger move_in_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to in position
		gotomarker upper_button_inA 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to out position
		gotomarker upper_button_outA 16
	}
	trigger move_up
	{
		//move button up
		gotomarker upper_button_inA 1800 wait
	}
	trigger move_down
	{
		//move button down
		gotomarker lower_button_inA 1800 wait
	}

	trigger setaccum0
	{
		accum 1 set 0
	}

	trigger setaccum1
	{
		accum 1 set 1
	}
}

//this is the actual lift script_mover
liftA
{
	spawn
	{
		//we want to set the initial postion of the lift to down
		//lift pos 0=down 1=up
		accum 1 set 0
	}
	trigger go_up
	{	
		//only continue if the lift is down
		accum 1 abort_if_not_equal 0
		
		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_down_clipA
		alertentity pbutton_down_clipA
		alertentity pbutton_up_clipA

		//floor 107 lights up on elevator panel///NEW
		remapshader "textures/wtc/lifta1" "textures/wtc/lifta107"
		remapshaderflush
		
		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the down position
		trigger lift_door1A close_down
		trigger lift_door2A close_down

		//close bottom doors			//***NEW***
		trigger door02_leftA close
		trigger door02_rightA close

		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors up
		trigger lift_door1A move_up
		trigger lift_door2A move_up

		//call the routines to move the button up
		trigger lift_buttonA move_up

		//now move the actual lift up
		gotomarker lift_upA 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert stae to up
		trigger lift_buttonA setaccum1

		//move the button out
		trigger lift_buttonA move_out_up
		
		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerA setaccum0

		//move the buttons out
		trigger lower_pbuttonA move_out
		trigger upper_pbuttonA move_out
		
		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerA setaccum0
		trigger upper_pbutton_in_triggerA setaccum0


		//set the lift position to up
		accum 1 set 1
		
		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the up position
		trigger lift_door1A open_up
		trigger lift_door2A open_up

		//open top doors			//***NEW***
		trigger door01_leftA open
		trigger door01_rightA open

		
		//now show the button triggers again
		alertentity button_up_clipA
		alertentity pbutton_up_clipA
		alertentity pbutton_down_clipA

	}
	trigger go_down
	{
		//only continue if the lift is up
		accum 1 abort_if_not_equal 1

		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_up_clipA
		alertentity pbutton_up_clipA
		alertentity pbutton_down_clipA

		//floor 1 lights up on elevator panel///NEW
		remapshader "textures/wtc/lifta1" "textures/wtc/lifta1"
		remapshaderflush

		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the up position
		trigger lift_door1A close_up
		trigger lift_door2A close_up

		//close top doors			//***NEW***
		trigger door01_leftA close
		trigger door01_rightA close


		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors down
		trigger lift_door1A move_down
		trigger lift_door2A move_down

		//call the routines to move the button down
		trigger lift_buttonA move_down

		//now move the actual lift down
		gotomarker lift_downA 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert state to down
		trigger lift_buttonA setaccum0

		//move the button out
		trigger lift_buttonA move_out_down

		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerA setaccum0

		//move the buttons out
		trigger lower_pbuttonA move_out
		trigger upper_pbuttonA move_out

		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerA setaccum0
		trigger upper_pbutton_in_triggerA setaccum0


		//set the lift position to down
		accum 1 set 0

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the down position
		trigger lift_door1A open_down
		trigger lift_door2A open_down

		//open bottom doors			//***NEW***
		trigger door02_leftA open
		trigger door02_rightA open


		//now show the button triggers again
		alertentity button_down_clipA
		alertentity pbutton_down_clipA
		alertentity pbutton_up_clipA
	}
}


//lift door 1
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door1A
{	
	spawn
	{	
		//start the door open
		trigger lift_door1A open_down
	}
	trigger open_down
	{
		gotomarker lift_door1A_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door1A_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door1A_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door1A_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door1A_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door1A_down_closed 1800 wait
	}
}

//lift door 2
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door2A
{	
	spawn
	{
		//start the door open
		trigger lift_door2A open_down
	}
	trigger open_down
	{
		gotomarker lift_door2A_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door2A_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door2A_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door2A_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door2A_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door2A_down_closed 1800 wait
	}
}

//------------------------------------------------------------------------------`
//
// Upper Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door01_leftA
{
	trigger open
	{
		gotomarker door01_left2A 70 wait
	}

	trigger close
	{
		gotomarker door01_left1A 70 wait
	}
}

door01_rightA
{
	trigger open
	{
		gotomarker door01_right2A 70 wait
	}

	trigger close
	{
		gotomarker door01_right1A 70 wait
	}
}

//------------------------------------------------------------------------------
//
// Lower Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door02_leftA
{
	trigger open
	{
		gotomarker door02_left2A 70 wait
	}

	trigger close
	{
		gotomarker door02_left1A 70 wait
	}
}

door02_rightA
{
	trigger open
	{
		gotomarker door02_right2A 70 wait
	}

	trigger close
	{
		gotomarker door02_right1A 70 wait
	}
}


//////////////////////////////////////////////////////////////////////////////////////
//LIFTB	
//this is the routine that is called by our target_script_trigger for the lower button
//
//////////////////////////////////////////////////////////////////////////////////////
lower_pbutton_in_triggerB
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger pbutton_inB
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger lower_pbuttonB move_in
		trigger upper_pbuttonB move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger upper_pbutton_in_triggerB setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftB go_up
		trigger liftB go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lower_pbuttonB
{
	trigger move_in
	{
		//move button to in position
		gotomarker lower_pbutton_inB 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker lower_pbutton_outB 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}

//this is the routine that is called by our target_script_trigger for teh upper button
upper_pbutton_in_triggerB
{
	spawn
	{

		accum 2 set 0
	}
	trigger pbutton_inB
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger upper_pbuttonB move_in
		trigger lower_pbuttonB move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger lower_pbutton_in_triggerB setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftB go_up
		trigger liftB go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual upper button script_mover
upper_pbuttonB
{
	trigger move_in
	{
		//move button to in position
		gotomarker upper_pbutton_inB 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker upper_pbutton_outB 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}



//this is the routine that is called by our target_script_trigger
lift_button_in_triggerB
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger button_inB
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//now move the lift
		//because there is no if then statement we simply call both routines
		//button will only move in at the up or down position
		trigger lift_buttonB move_in_down
		trigger lift_buttonB move_in_up

		//set button state to 1 (in)
		accum 2 set 1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftB go_up
		trigger liftB go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lift_buttonB
{
	spawn
	{
		//button vert position 0=down 1=up
		accum 1 set 0
	}
	trigger move_in_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to in position
		gotomarker lower_button_inB 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to out position
		gotomarker lower_button_outB 16
	}
	trigger move_in_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to in position
		gotomarker upper_button_inB 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to out position
		gotomarker upper_button_outB 16
	}
	trigger move_up
	{
		//move button up
		gotomarker upper_button_inB 1800 wait
	}
	trigger move_down
	{
		//move button down
		gotomarker lower_button_inB 1800 wait
	}

	trigger setaccum0
	{
		accum 1 set 0
	}

	trigger setaccum1
	{
		accum 1 set 1
	}
}

//this is the actual lift script_mover
liftB
{
	spawn
	{
		//we want to set the initial postion of the lift to down
		//lift pos 0=down 1=up
		accum 1 set 0
	}
	trigger go_up
	{	
		//only continue if the lift is down
		accum 1 abort_if_not_equal 0
		
		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_down_clipB
		alertentity pbutton_down_clipB
		alertentity pbutton_up_clipB

		//floor 107 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftb1" "textures/wtc/liftb107"
		remapshaderflush
		
		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the down position
		trigger lift_door1B close_down
		trigger lift_door2B close_down

		//close bottom doors			//***NEW***
		trigger door02_leftB close
		trigger door02_rightB close

		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors up
		trigger lift_door1B move_up
		trigger lift_door2B move_up

		//call the routines to move the button up
		trigger lift_buttonB move_up

		//now move the actual lift up
		gotomarker lift_upB 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert stae to up
		trigger lift_buttonB setaccum1

		//move the button out
		trigger lift_buttonB move_out_up
		
		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerB setaccum0

		//move the buttons out
		trigger lower_pbuttonB move_out
		trigger upper_pbuttonB move_out
		
		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerB setaccum0
		trigger upper_pbutton_in_triggerB setaccum0


		//set the lift position to up
		accum 1 set 1
		
		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the up position
		trigger lift_door1B open_up
		trigger lift_door2B open_up

		//open top doors			//***NEW***
		trigger door01_leftB open
		trigger door01_rightB open

		
		//now show the button triggers again
		alertentity button_up_clipB
		alertentity pbutton_up_clipB
		alertentity pbutton_down_clipB

	}
	trigger go_down
	{
		//only continue if the lift is up
		accum 1 abort_if_not_equal 1

		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_up_clipB
		alertentity pbutton_up_clipB
		alertentity pbutton_down_clipB

		//floor 1 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftb1" "textures/wtc/liftb1"
		remapshaderflush

		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the up position
		trigger lift_door1B close_up
		trigger lift_door2B close_up

		//close top doors			//***NEW***
		trigger door01_leftB close
		trigger door01_rightB close


		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors down
		trigger lift_door1B move_down
		trigger lift_door2B move_down

		//call the routines to move the button down
		trigger lift_buttonB move_down

		//now move the actual lift down
		gotomarker lift_downB 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert state to down
		trigger lift_buttonB setaccum0

		//move the button out
		trigger lift_buttonB move_out_downB

		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerB setaccum0

		//move the buttons out
		trigger lower_pbuttonB move_out
		trigger upper_pbuttonB move_out

		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerB setaccum0
		trigger upper_pbutton_in_triggerB setaccum0


		//set the lift position to down
		accum 1 set 0

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the down position
		trigger lift_door1B open_down
		trigger lift_door2B open_down

		//open bottom doors			//***NEW***
		trigger door02_leftB open
		trigger door02_rightB open


		//now show the button triggers again
		alertentity button_down_clipB
		alertentity pbutton_down_clipB
		alertentity pbutton_up_clipB
	}
}


//lift door 1
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door1B
{	
	spawn
	{	
		//start the door open
		trigger lift_door1B open_down
	}
	trigger open_down
	{
		gotomarker lift_door1B_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door1B_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door1B_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door1B_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door1B_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door1B_down_closed 1800 wait
	}
}

//lift door 2
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door2B
{	
	spawn
	{
		//start the door open
		trigger lift_door2B open_down
	}
	trigger open_down
	{
		gotomarker lift_door2B_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door2B_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door2B_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door2B_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door2B_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door2B_down_closed 1800 wait
	}
}

//------------------------------------------------------------------------------`
//
// Upper Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door01_leftB
{
	trigger open
	{
		gotomarker door01_left2B 70 wait
	}

	trigger close
	{
		gotomarker door01_left1B 70 wait
	}
}

door01_rightB
{
	trigger open
	{
		gotomarker door01_right2B 70 wait
	}

	trigger close
	{
		gotomarker door01_right1B 70 wait
	}
}

//------------------------------------------------------------------------------
//
// Lower Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door02_leftB
{
	trigger open
	{
		gotomarker door02_left2B 70 wait
	}

	trigger close
	{
		gotomarker door02_left1B 70 wait
	}
}

door02_rightB
{
	trigger open
	{
		gotomarker door02_right2B 70 wait
	}

	trigger close
	{
		gotomarker door02_right1B 70 wait
	}
}



//////////////////////////////////////////////////////////////////////////////////////
//LIFTC	
//this is the routine that is called by our target_script_trigger for the lower button
//
//////////////////////////////////////////////////////////////////////////////////////
lower_pbutton_in_triggerC
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger pbutton_inC
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger lower_pbuttonC move_in
		trigger upper_pbuttonC move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger upper_pbutton_in_triggerC setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftC go_up
		trigger liftC go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lower_pbuttonC
{
	trigger move_in
	{
		//move button to in position
		gotomarker lower_pbutton_inC 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker lower_pbutton_outC 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}

//this is the routine that is called by our target_script_trigger for teh upper button
upper_pbutton_in_triggerC
{
	spawn
	{

		accum 2 set 0
	}
	trigger pbutton_inC
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger upper_pbuttonC move_in
		trigger lower_pbuttonC move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger lower_pbutton_in_triggerC setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftC go_up
		trigger liftC go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual upper button script_mover
upper_pbuttonC
{
	trigger move_in
	{
		//move button to in position
		gotomarker upper_pbutton_inC 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker upper_pbutton_outC 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}



//this is the routine that is called by our target_script_trigger
lift_button_in_triggerC
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger button_inC
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//now move the lift
		//because there is no if then statement we simply call both routines
		//button will only move in at the up or down position
		trigger lift_buttonC move_in_down
		trigger lift_buttonC move_in_up

		//set button state to 1 (in)
		accum 2 set 1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftC go_up
		trigger liftC go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lift_buttonC
{
	spawn
	{
		//button vert position 0=down 1=up
		accum 1 set 0
	}
	trigger move_in_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to in position
		gotomarker lower_button_inC 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to out position
		gotomarker lower_button_outC 16
	}
	trigger move_in_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to in position
		gotomarker upper_button_inC 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to out position
		gotomarker upper_button_outC 16
	}
	trigger move_up
	{
		//move button up
		gotomarker upper_button_inC 1800 wait
	}
	trigger move_down
	{
		//move button down
		gotomarker lower_button_inC 1800 wait
	}

	trigger setaccum0
	{
		accum 1 set 0
	}

	trigger setaccum1
	{
		accum 1 set 1
	}
}

//this is the actual lift script_mover
liftC
{
	spawn
	{
		//we want to set the initial postion of the lift to down
		//lift pos 0=down 1=up
		accum 1 set 0
	}
	trigger go_up
	{	
		//only continue if the lift is down
		accum 1 abort_if_not_equal 0
		
		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_down_clipC
		alertentity pbutton_down_clipC
		alertentity pbutton_up_clipC

		//floor 107 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftc1" "textures/wtc/liftc107"
		remapshaderflush
		
		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the down position
		trigger lift_door1C close_down
		trigger lift_door2C close_down

		//close bottom doors			//***NEW***
		trigger door02_leftC close
		trigger door02_rightC close

		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors up
		trigger lift_door1C move_up
		trigger lift_door2C move_up

		//call the routines to move the button up
		trigger lift_buttonC move_up

		//now move the actual lift up
		gotomarker lift_upC 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert stae to up
		trigger lift_buttonC setaccum1

		//move the button out
		trigger lift_buttonC move_out_up
		
		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerC setaccum0

		//move the buttons out
		trigger lower_pbuttonC move_out
		trigger upper_pbuttonC move_out
		
		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerC setaccum0
		trigger upper_pbutton_in_triggerC setaccum0


		//set the lift position to up
		accum 1 set 1
		
		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the up position
		trigger lift_door1C open_up
		trigger lift_door2C open_up

		//open top doors			//***NEW***
		trigger door01_leftC open
		trigger door01_rightC open

		
		//now show the button triggers again
		alertentity button_up_clipC
		alertentity pbutton_up_clipC
		alertentity pbutton_down_clipC

	}
	trigger go_down
	{
		//only continue if the lift is up
		accum 1 abort_if_not_equal 1

		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_up_clipC
		alertentity pbutton_up_clipC
		alertentity pbutton_down_clipC

		//floor 1 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftc1" "textures/wtc/liftc1"
		remapshaderflush

		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the up position
		trigger lift_door1C close_up
		trigger lift_door2C close_up

		//close top doors			//***NEW***
		trigger door01_leftC close
		trigger door01_rightC close


		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors down
		trigger lift_door1C move_down
		trigger lift_door2C move_down

		//call the routines to move the button down
		trigger lift_buttonC move_down

		//now move the actual lift down
		gotomarker lift_downC 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert state to down
		trigger lift_buttonC setaccum0

		//move the button out
		trigger lift_buttonC move_out_down

		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerC setaccum0

		//move the buttons out
		trigger lower_pbuttonC move_out
		trigger upper_pbuttonC move_out

		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerC setaccum0
		trigger upper_pbutton_in_triggerC setaccum0


		//set the lift position to down
		accum 1 set 0

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the down position
		trigger lift_door1C open_down
		trigger lift_door2C open_down

		//open bottom doors			//***NEW***
		trigger door02_leftC open
		trigger door02_rightC open


		//now show the button triggers again
		alertentity button_down_clipC
		alertentity pbutton_down_clipC
		alertentity pbutton_up_clipC
	}
}


//lift door 1
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door1C
{	
	spawn
	{	
		//start the door open
		trigger lift_door1C open_down
	}
	trigger open_down
	{
		gotomarker lift_door1C_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door1C_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door1C_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door1C_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door1C_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door1C_down_closed 1800 wait
	}
}

//lift door 2
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door2C
{	
	spawn
	{
		//start the door open
		trigger lift_door2C open_down
	}
	trigger open_down
	{
		gotomarker lift_door2C_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door2C_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door2C_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door2C_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door2C_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door2C_down_closed 1800 wait
	}
}

//------------------------------------------------------------------------------`
//
// Upper Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door01_leftC
{
	trigger open
	{
		gotomarker door01_left2C 70 wait
	}

	trigger close
	{
		gotomarker door01_left1C 70 wait
	}
}

door01_rightC
{
	trigger open
	{
		gotomarker door01_right2C 70 wait
	}

	trigger close
	{
		gotomarker door01_right1C 70 wait
	}
}

//------------------------------------------------------------------------------
//
// Lower Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door02_leftC
{
	trigger open
	{
		gotomarker door02_left2C 70 wait
	}

	trigger close
	{
		gotomarker door02_left1C 70 wait
	}
}

door02_rightC
{
	trigger open
	{
		gotomarker door02_right2C 70 wait
	}

	trigger close
	{
		gotomarker door02_right1C 70 wait
	}
}


//////////////////////////////////////////////////////////////////////////////////////
//LIFTD	
//this is the routine that is called by our target_script_trigger for the lower button
//
//////////////////////////////////////////////////////////////////////////////////////
lower_pbutton_in_triggerD
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger pbutton_inD
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger lower_pbuttonD move_in
		trigger upper_pbuttonD move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger upper_pbutton_in_triggerD setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftD go_up
		trigger liftD go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lower_pbuttonD
{
	trigger move_in
	{
		//move button to in position
		gotomarker lower_pbutton_inD 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker lower_pbutton_outD 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}

//this is the routine that is called by our target_script_trigger for teh upper button
upper_pbutton_in_triggerD
{
	spawn
	{

		accum 2 set 0
	}
	trigger pbutton_inD
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//call the actual button move routines
		trigger upper_pbuttonD move_in
		trigger lower_pbuttonD move_in

		//set button states to 1 (in)
		accum 2 set 1
		trigger lower_pbutton_in_triggerD setaccum1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftD go_up
		trigger liftD go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual upper button script_mover
upper_pbuttonD
{
	trigger move_in
	{
		//move button to in position
		gotomarker upper_pbutton_inD 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out
	{
		//move button to out position
		gotomarker upper_pbutton_outD 16
		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
}



//this is the routine that is called by our target_script_trigger
lift_button_in_triggerD
{
	spawn
	{	
		//button position 0=out 1=in
		accum 2 set 0
	}
	trigger button_inD
	{
		//if accum 2 is NOT 0 we cant move in
		accum 2 abort_if_not_equal 0

		//now move the lift
		//because there is no if then statement we simply call both routines
		//button will only move in at the up or down position
		trigger lift_buttonD move_in_down
		trigger lift_buttonD move_in_up

		//set button state to 1 (in)
		accum 2 set 1

		//now move the lift
		//because there is no if then statement we simply call both routines
		//lift will only move up if it is down, or down if it is up
		//regardless of what button was pressed
		trigger liftD go_up
		trigger liftD go_down
	}
	trigger setaccum0
	{
		accum 2 set 0
	}
	trigger setaccum1
	{
		accum 2 set 1
	}
}

//this is the actual lower button script_mover
lift_buttonD
{
	spawn
	{
		//button vert position 0=down 1=up
		accum 1 set 0
	}
	trigger move_in_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to in position
		gotomarker lower_button_inD 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_down
	{
		//if we are not down leave
		accum 1 abort_if_not_equal 0

		//move button to out position
		gotomarker lower_button_outD 16
	}
	trigger move_in_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to in position
		gotomarker upper_button_inD 16

		//play sound effect
		playsound sound\movers\elevators\elevatording.wav
	}
	trigger move_out_up
	{
		//if we are not up leave
		accum 1 abort_if_not_equal 1

		//move button to out position
		gotomarker upper_button_outD 16
	}
	trigger move_up
	{
		//move button up
		gotomarker upper_button_inD 1800 wait
	}
	trigger move_down
	{
		//move button down
		gotomarker lower_button_inD 1800 wait
	}

	trigger setaccum0
	{
		accum 1 set 0
	}

	trigger setaccum1
	{
		accum 1 set 1
	}
}

//this is the actual lift script_mover
liftD
{
	spawn
	{
		//we want to set the initial postion of the lift to down
		//lift pos 0=down 1=up
		accum 1 set 0
	}
	trigger go_up
	{	
		//only continue if the lift is down
		accum 1 abort_if_not_equal 0
		
		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_down_clipD
		alertentity pbutton_down_clipD
		alertentity pbutton_up_clipD

		//floor 107 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftd1" "textures/wtc/liftd107"
		remapshaderflush
		
		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the down position
		trigger lift_door1D close_down
		trigger lift_door2D close_down

		//close bottom doors			//***NEW***
		trigger door02_leftD close
		trigger door02_rightD close

		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors up
		trigger lift_door1D move_up
		trigger lift_door2D move_up

		//call the routines to move the button up
		trigger lift_buttonD move_up

		//now move the actual lift up
		gotomarker lift_upD 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert stae to up
		trigger lift_buttonD setaccum1

		//move the button out
		trigger lift_buttonD move_out_up
		
		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerD setaccum0

		//move the buttons out
		trigger lower_pbuttonD move_out
		trigger upper_pbuttonD move_out
		
		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerD setaccum0
		trigger upper_pbutton_in_triggerD setaccum0


		//set the lift position to up
		accum 1 set 1
		
		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the up position
		trigger lift_door1D open_up
		trigger lift_door2D open_up

		//open top doors			//***NEW***
		trigger door01_leftD open
		trigger door01_rightD open

		
		//now show the button triggers again
		alertentity button_up_clipD
		alertentity pbutton_up_clipD
		alertentity pbutton_down_clipD

	}
	trigger go_down
	{
		//only continue if the lift is up
		accum 1 abort_if_not_equal 1

		//turn on the func_invis_user clip for the buttons
		//we cannot move this so only way to disable it is to hide it
		alertentity button_up_clipD
		alertentity pbutton_up_clipD
		alertentity pbutton_down_clipD

		//floor 1 lights up on elevator panel///NEW
		remapshader "textures/wtc/liftd1" "textures/wtc/liftd1"
		remapshaderflush

		//wait 1/10 second
		wait 100

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to close both doors in the up position
		trigger lift_door1D close_up
		trigger lift_door2D close_up

		//close top doors			//***NEW***
		trigger door01_leftD close
		trigger door01_rightD close


		//wait 2 seconds
		wait 2000

		//start the elevator sound
		playsound sound\wtc\elev_run.wav LOOPING

		//call the routines to move the doors down
		trigger lift_door1D move_down
		trigger lift_door2D move_down

		//call the routines to move the button down
		trigger lift_buttonD move_down

		//now move the actual lift down
		gotomarker lift_downD 1800 wait

		//stop looping sound and play lift end sound
		stopsound
		playsound sound\wtc\elev_stop.wav

		//wait 1 second
		wait 1000

		//set button vert state to down
		trigger lift_buttonD setaccum0

		//move the button out
		trigger lift_buttonD move_out_downB

		//and set the button accum so we can re-trigger it
		trigger lift_button_in_triggerD setaccum0

		//move the buttons out
		trigger lower_pbuttonD move_out
		trigger upper_pbuttonD move_out

		//and set the accum so we can re-trigger them
		trigger lower_pbutton_in_triggerD setaccum0
		trigger upper_pbutton_in_triggerD setaccum0


		//set the lift position to down
		accum 1 set 0

		//play door sound
		playsound sound\movers\elevators\elevatordoor.wav

		//call the routines to open both doors in the down position
		trigger lift_door1D open_down
		trigger lift_door2D open_down

		//open bottom doors			//***NEW***
		trigger door02_leftD open
		trigger door02_rightD open


		//now show the button triggers again
		alertentity button_down_clipD
		alertentity pbutton_down_clipD
		alertentity pbutton_up_clipD
	}
}


//lift door 1
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door1D
{	
	spawn
	{	
		//start the door open
		trigger lift_door1D open_down
	}
	trigger open_down
	{
		gotomarker lift_door1D_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door1D_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door1D_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door1D_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door1D_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door1D_down_closed 1800 wait
	}
}

//lift door 2
//the functions are self explanitory here
//routines needed for open up/down, close up/down and move up/down
//simply moves the door to the path_corner specified at the specified speed
lift_door2D
{	
	spawn
	{
		//start the door open
		trigger lift_door2D open_down
	}
	trigger open_down
	{
		gotomarker lift_door2D_down_open 70 wait
	}
	trigger close_down
	{
		gotomarker lift_door2D_down_closed 70 wait
	}
	trigger open_up
	{
		gotomarker lift_door2D_up_open 70 wait
	}
	trigger close_up
	{
		gotomarker lift_door2D_up_closed 70 wait
	}
	trigger move_up
	{
		gotomarker lift_door2D_up_closed 1800 wait
	}
	trigger move_down
	{
		gotomarker lift_door2D_down_closed 1800 wait
	}
}

//------------------------------------------------------------------------------`
//
// Upper Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door01_leftD
{
	trigger open
	{
		gotomarker door01_left2D 70 wait
	}

	trigger close
	{
		gotomarker door01_left1D 70 wait
	}
}

door01_rightD
{
	trigger open
	{
		gotomarker door01_right2D 70 wait
	}

	trigger close
	{
		gotomarker door01_right1D 70 wait
	}
}

//------------------------------------------------------------------------------
//
// Lower Doors outside of Lift 1
//
//------------------------------------------------------------------------------
door02_leftD
{
	trigger open
	{
		gotomarker door02_left2D 70 wait
	}

	trigger close
	{
		gotomarker door02_left1D 70 wait
	}
}

door02_rightD
{
	trigger open
	{
		gotomarker door02_right2D 70 wait
	}

	trigger close
	{
		gotomarker door02_right1D 70 wait
	}
}

// NEUTRAL COMMAND POST ================================================
// FROM Goldrush Thx SD!!! prefab by seven 2003 

allied_compost_built
{
	spawn
	{
		wait 400
		trigger allied_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
	}

	buildstart final
	{
		setstate allied_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate allied_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger allied_compost_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger allied_compost_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_compost_built_model
{
	spawn
	{
		wait 400
		setstate allied_compost_built_model invisible
	}

	trigger enable_allied_features
	{
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 1 1

		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 2
		wm_objective_status 5 1 1
	}

	trigger disable_allied_features
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0

		wm_announce	"Axis team has destroyed the Allied Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
	}
}

axis_compost_built
{
	spawn
	{
		wait 400
		trigger axis_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
	}

	buildstart final
	{
		setstate axis_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate axis_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger axis_compost_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger axis_compost_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_compost_built_model
{
	spawn
	{
		wait 400
		setstate axis_compost_built_model invisible
	}

	trigger enable_axis_features
	{
		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
		sethqstatus 0 1

		wm_announce	"Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 1
		wm_objective_status 5 1 2
	}

	trigger disable_axis_features
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0

		wm_announce	"Allied team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"

		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
	}
}


//Breakable windows

win1
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win2
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win3
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win4
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win5
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win6
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win7
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win8
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win9
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win10
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win11
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win12
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win13
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win14
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win15
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win16
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win17
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win18
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win19
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win20
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win21
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win22
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win23
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win24
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win25
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win26
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win27
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win28
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win29
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win30
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win31
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win32
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win33
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win34
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win35
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win36
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win37
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win38
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win39
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win40
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win41
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win42
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win43
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win44
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win45
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win46
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win47
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

win48
{
    spawn
    {
        wait 200
        constructible_class 1
    }

    death
    {
    }
}

